package com.axjy.web;

import com.alibaba.fastjson.JSON;
import com.axjy.pojo.Plan;
import com.axjy.service.PlanService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 王松 on 2018/1/27.
 */
@Controller
@RequestMapping("/sys/plan")
public class PlanHandler {
    @Resource
    private PlanService planService;

    @RequestMapping("/toplan")
    public String toPlan(){
        return "plan/plan";
    }

    @GetMapping("/list")
    public String plan(){
        List<Plan> list = planService.list();
        return JSON.toJSONString(list);
    }
}
